package com.xn2001.controller;

import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 乐心湖
 * @date 2020/5/23 13:33
 **/
@RestController
@Slf4j
public class LoggerController {

    @GetMapping("/logger")
    public String logger() {
        Logger logger = LoggerFactory.getLogger(LoggerController.class);
        logger.info("Hello World 1");
        return "哈哈，访问成功。 1";
    }

    @GetMapping("/logger2")
    public String loggerTwo() {
        log.warn("Hello World 2");
        return "哈哈，访问成功。 2";
    }

}
